bugfix for creating new threads