Missing if statement - copy/paste typo