Fixed problem with if