new method waitForKey