fixed using pasture from global variable