modified code
changes on defender logic