Resolved deadlock problem