Fixed memory leak in server
Possible fix for some key fails