Fixed deadlock issue because I am really good at locks.