fix CustomDataAttributes and add unit test for it