fix a bug in append_phase.c