moving lock before errors