fixed duplciated button bug and other misc tweaks