fixes http server logic