rewritting createCalTrigger