Check if task exists