return 500 if error is caught