I am trying to update a text dynamically but without success. clicking on a button the text is updated