fix if statement issues