replace groovy code with card script