fix next buffer memory