added try catch
added trycatch