fix bug when resuming file stream