try to fix race condition to registerButton and registerParam + handle paste event