fixed minor error in canAttack