fixing memcpy