fix if condition