fixed bugs in http server