improve buttons functionality