the offset should be changed after memcpy