Solving infinite loop when getting options on main