Ran into some thread safety issues