fix issues when using https