added localhost support