Error handler corrected