added some menu selection logic