change buffer datatype to void*