make it work with https as well