bugfix in pgorder