Added in a console log to see how env is set up on heroku
More attempt to find heroku env setup
More attempt to find heroku env setup
refactored file write method