index added and fixed count issue