fix 945 by parse fn, 1117 by using better input way