Make global buff be memory instead