fixed deletion bugs!!!