change error handling against 500