Added a button handler to the inputs