added agree logic