fixing input parsing functionality