Added check in multiplication function
Minor fix