fix a bug in Phi