working function params for copying buffer