modified a bug in phrasetable_m function