added in logging and support for heroku