added try catch statements