Found the line of code that made the unusual behavior of the button click. There are two elements with the same Register id.