avoid inifite loop in mapbuffer::save