Changed deletion function