added a tryCatch