Fixed updateAgent's buggy need processing