Added code for compatibility with heroku