changed events to query based on end datetime not start datetime