Added a check to ensure deleted tasks don't show up.