Changed write_http for local testing