fixed pg errors