Removed deadlock code