Whoops nevermind the problem was missing an else block