add function to save the gem data.