batch ref close function rebuild