Added button handler and gets the values