fixed redirect loop error when heroku domain was changed