Why is Nifty adjusted to a lower price after closing Bell?

I have seen this happening, but do not know why or how? What am I missing? Today at 3:30 Nifty closed around 13,017, but a few moments after closing it was reduced down to 12987, why is that?

I was holding a 13000 CE option, and lost all my money, even though in my head Nifty was closing at 13,017.

The closing price which you see at 3:30 PM in LTP (Last Traded Price), after market closes exchange adjusts final closing price to Weighted Average Price of last 30 minutes, so the final closing price will always be different from LTP. More on this has been explained here.