fixed buffer not clearing