added handle of buttons