Refined the tryCatch