checkLocations now returns flag corresponding to the node clicked