changed http post call and fixed memory leak due to pkt not being freed