fix if else statement