Adding checking to avoid adding duplicates