Retrieving pending tasks