added code to not crash when reading event files