Switched if to unless to satisfy rubycop