Noticed a problem with an if statement and corrected