add and remove fold in js part