Edited for localhost support