fixes buffer error