made buffer a static variable.