Fixed multithreading but core data bug exists