fix event pop and add logging