added try-catch