clean up initBuffer