fixed heroku
Fixed a problem with a postgres function