added a try-catch to be graceful