writeToFile every time it checks something