add keypress to buttons, fixed bugs