fix invalid input id; perf tuning; set thread priority