fix if statement conditions