updated to work with https