console logs for heroku and better error handling