need loop for case when tail.head is null otherwise we skip this.global