fixed deletion bugs