added support for multiple task output files due to rewind