Fix bug for multiple hosts