changed to support http/https