fix 'temporary file unavailable' bug