fixed bug with Postgres