fixed bug where tab doesn't clear buffer