Updated to work in heroku