fixed get mask by memcpy