Add if statement in post controller.