fixed bug in pha.py