fix pg issues