Fixed bug with exclude agent function, fixed exclude agent logic