fix problem with delays when using keyboard