fix if-stmt