cleaned up query printing for heroku