Adding function to insert related cards