Added stats for active and pending tasks