Move choice validation function outside main loop