pg error fixing