Changed order of if