to work with either localhost or server