Added if statement in User controller