Modified if-statement to reflect what was originally meant