Fixed issue with postgres database