fixed multiplication function
added a try catch handler