Only writes to file upon refresh