fixing bugs in the next event feature