chunk handling module, error handling - note err_stop does not work with chunks atm