fix incorrect if statemet