add read config functions and val.sh