WIP to fix delete bug