fixed a bug where post index wasnt getting updated