updated for multiple hosts