fixing an input parsing error when there is wrong input format