Fixing delete bug