update and fix reading file input parsing