bugfix for posix thread