fixed thread locking issues
visual c++ does not yet have member function delete functionality