Quick fix 2

* Moved an if statement to where it will be run