Fix search and save array locally