few syntax errors resolved for pg