Empty buffer each time instead of going character by character.