fix if statement