take only last occurence