fix if-statement