improve buffer switching - fix