fix crash in HTTP server mode