modify index and adjust pages