only start packaging after finishing writing files to disk

[closes #1]