Added isAttacking check and sending event