added temporaryfix for multithreading problems.