Works great locally, shows internal server error on heroku