changin control logic in spiagent