How to stop the update function after a body is given the velocity

I am trying to make a basic game where an arrow is shooted to hit a balloon so that it bursts. I am done with the rotation of the arrow in the direction where I want to shoot. But the problem is that the update function keeps rotating the arrow in the direction of the cursor even after the arrow is shooted.

(’"
function update ()
{

var pointer = this.input.activePointer;
if (pointer.isDown) {
arrow.rotation = Math.atan2(this.input.y - arrow.y, this.input.x - arrow.x);
cannon.rotation = Math.atan2(this.input.y - cannon.y, this.input.x - cannon.x);
// …
}

}

"’)

Basically here in the update function
cannon = bow
arrow = arrow
Both bow and arrow are updated as the pointer moves. And when the pointer is released (pointerup) the arrow shoots. But when it is in the air the update function is still working and the arrow is rotating in the air when my pointer is down.