updated the query for heroku