Timed events at specific time?

The original author put the main loop there, something about the finalizewav function....I have redone the main and loop section into one, now i can print the time from rtc, but have a problem where now the second it hits the event time (in this case say 12:30 to play file xyz) it crashes the system, its trying to open the file every ms even if the time is flagged for a certain second.