fixed buffer error