fixed crash bug in PM system; thanks, savander!