added try catches