fixed deletion logic
fixed compile issue