added try block