added logic to roll back to http from https