add/remove buttons & fix some bugs