a better error handling
clearing errors