handle button input