before locking