improving menu script logic.