added conditionals for ssl