added try/catch blocks