Updated fileEventHandler