added support for http as well as https