fix implementation of upcoming events. Fixes #496