Added chunked write