Added processing of pending tasks