fixed unknown variable mapindex