tweaked to work on Heroku