added try catch block
added try catch block