Updated FrameManager to flush if new buffer size is smaller than current buffer