constructor changed to be compatible with heroku