readded clearBuffer