Moved try-catch surrounding all logic in handler