Fix double keypress bug