passing loc data to avoid name error