use forloop instead of FindIndex