added test and fixed setHost