deadlock problem fixed