fixed table removal bug