added GCD for key input; pause now works