Implemented door lock function