Added diversion into lock function at door