fix bugs wtih js and card aggs