fixed temp file bug