add index function after save message