Trying to fix the ever-present multithreading issues