Error handler works properly now