nil length issues sorted