cleanup and make sure we send the client back some sensible answer, if possible