fix buffer