edited mistake in checking locks