this is a better way for adding location.protocol.