add new error handling and change some names
mrege with xff