handling duplicate entries