Internal Server Error handler updated to avoid concurrency issue.