added option to use https