added 500 error handling to settings page