Fixed if-statement logic on mail rake