clear flag was wrong