ensure temp file is created correctly