Make ending input cycle more reliable