changed deletion logic