Use try-catch to prevent error messages