Fix if statement in main router