add keypress fixes and clean up