Added back generic error handling