Fix erroneous check