minor edit to make it work with postgres