fixed non-compatible with pg
fixed missing line terminator bug