improve paste functionality