Added condition for http and https