Fixed bug for HTTPS