Fixed small deadlock