fix a bug wrt mp code parsing