implementing canBeDeleted functionality