fix mistake in Q checking