improve error handling
update version
change update method to support chunked transfer encoding