fix error in removing states