fix exception on paste event