It should be applied at EVENT_TURN_END, not PHASE_END.
Attach a file by drag & drop or click to upload