input parsing bug fix