fix code to make it possible to deploy on heroku