fixing https, adding min