findClosestByPath returns a single value not an array - so dont use dropenergy[0] but just dropenergy   as for the storage finding loop, do the same - use findclosest rather than find