fix bug in refinery