fix isDeleted method; use isScheduledForDelete to check if the entity is planned to be deleted or not.