added a function to cleanup the leftjoin results. see __remove_dup