bugfix for postgres