Fix bug with read / write connection and inserting into Postgres.