fix stockpile issue