added a custom 500 handler