Fixed defend function