Fixing bind of onKeyPress event