fixed bugs for buttons