fixed some memory leaks, discovered single threaded mode is critical for redis to work