fixed pg bug