changed how active device count is calculated