chnge agent status logic