fix http and https issues