fix read_prep.py function errors