Fixed paste event handler