update index and add ajax