Upcoming events query bugfix