Tpem bug fixed