fix key press handling issue
misc changes