Fix delete table bug