Copy from heroku sample