Fix php error when display host states in homepage