Box2D body can not stop

Hey i have another issue regarding jump sprite body. In my code i am using moveLeft and moveRight Button and when i am press moveRight Button using following code

Code:
    if (moveRight.active==YES)
        {
                b2Vec2 force=b2Vec2(4,0);
                ballBody->SetLinearVelocity(force);               
        }
Its move perfectly and When i release this Button than sprite body stop using following code

Code:
else
    {
          b2Vec2 force=b2Vec2(0,0);
          ballBody->SetLinearVelocity(force);
    }

But when i put this else part then jump can not done. My jump code is following


Code:
    if (jumpSprite.active==YES)
                    {
                        NSLog(@"Jump Sprite");
                        b2Vec2 locationWorld;
                        locationWorld=b2Vec2(0.0f,4.0f);
                        double force=ballBody->GetMass();
                        ballBody->ApplyLinearImpulse(force*locationWorld, ballBody->GetWorldCenter());
                    }

If i remove else part then jump will perform complete but sprite body can not stop after release button.

In picture right bottom is jump button and left two buttons are used moveLeft & moveRight
So what to do??

Thanks in advance
I think you just need to keep the vertical part of the velocity unchanged:
Code:
b2Vec2 force=b2Vec2(0, ballBody->GetLinearVelocity().y );
ballBody->SetLinearVelocity(force);

Original thread: https://box2d.org/forum/viewtopic.php?t=8789