Added a step before locking