Possibly fixed the strange bug by only refreshing on a toggle, and removing the tmp file on every highlight