Fixes syntax error from previous commit - needed an end for an if