Added some error detection of deleted task