added 'countAttribute' option for references.