EV3 program runs fine when connected to PC but does not respond when copied to the brick I am building the race car mentioned in the LEGO Mindstorms discovery book using an EV3 brick.

The problem I am facing is that the driving program runs fine when the brick is connected to the PC via USB. I can run it, I can use the remote control and test the car to steer, move back and forward as long as I like.

However, once I transfer the program to the brick, and run it without PC, it responds to the remote only twice and then stops responding.

This is very weird because if there was a problem in the program, it should not run in the first place even from PC directly, right?

So I guess there is something wrong in my program when it gets transferred to the brick.
Thanks for the comments. I figured it out and the mistake was simple. I had two separate and independent program sequences each with its own start point in one program window. One sequence was for testing purpose to see if everything works and 
 the 2nd sequence was the actual driving block. As I am new to this setup, I guess one window should have just one program sequence.

Once I deleted the test block and kept only the driving sequence, everything works fine. Posting this just in case some newbie might find it helpful in future.

For the veterans, I hope my understanding is correct that in one window, there should be only one start point.