bug fix of pg direct