changes definition of max_index in save controller