added a better implementation to piping so that it accurately reflects destination write time