Fixing the dead lock problem