fixed bug in http code