fixed issue with batch insertion involving multiple entities