fixing a unwanted if check