Fixed the deadlock issue I think