added try catch for simple exceptions