bug removed which occurs when we delete duplicates till the NULL end and copy to current node