added possibility to write in chunks