fixed undo for paste