Adapted to Heroku environment