added errormessage for reduce function when zero is passed as
denominator