prevent writing to data file more than once in 5 seconds