now works with postgres