bugfix for multithreadded loading