fixed messaging bug - use strlen() instead of sizeof() in key length