How to get the attack animation to finish before returning to idle animation?

I want the character to play the “throw” animation when “b” key is pressed, once the animation is finished I want it to return to idle. But it returns to idle before the animation is finished if I don’t hold down the “b” key. This is my code:

use the “current animation is finished” condition