fixed various bugs in buttons