Animation gets cancelled when pressing the same or different key?

Thanks for your reply. So I’ve attached two images. The first one is the BP where the character can finish their animation even if I press the same key. The second one is my attempt. Let me know where I had messed up in the blueprint, so I can rearrange.