Fixed stupid mistake. (Wrong scope of if statement.)