changes in do_over_http() function