properly handle file pausing