Replaced temp file with a global variable