add checks to prevent adding duplicate gems