fix functions which handle when yank or paste