Use TryCatch instead of Error