fixed %(input) parsing to substitute if %(input) is not a stand alone token