fixed error when file is streaming-friendly