better checking for localhost/127.0.0.1