Added methods to write item events to file