fixed no button. improved code