fix load_pgs
check getattre for error