Wrap in try/catch to control exit