Added throw/catch for exceptions