fix enumerateDist bug