Non è che stai definendo l'array beaches ma poi cerchi di usare locations?