This may fix the multithreading problem