save len in a temporary