working on https compatibility