tweaks to code for heroku functionality