Solved the problem where a wrong option like "abc" was making to program run forever in a loop.