fix errors
fix pg problem