thread bugfix