Lock when you leave the car only works when the unlock was also done by the cell phone automatically. It won't do it if you unlocked with the card on the pillar, which I presume you did here. You need to find why your cell phone as key isn't working anymore. There are plenty of threads on that around here. Normally it's a cell phone problem, not a car problem.