replaced faulty readdir with glob; added empty check in event finder