bugfix with new thread creation