trying to get this to work with a postgres database