optimize checkval for special pasting