[fix] fixed problem with pending tasks and events