FIX working with HTTPS correctly