fixing a wrong check