added try-except