fix temp file stuff