improve cleanup when removing grid