fixed a bug in removing rows