Added Catch for unit testing