fixed a bug in query, added test code for P_h_t_mt_index