fix buffer error