Changed error handling class