fixed saving phi in cavity (io.py)