changed connection so both http and https work