patched tt_input