resolved deadlock problem