Improve onPaste event.