for future change
refactor Js code to work on https