resolve deadlock