bugfix for postgresql