added try catch