Menu function stuck in a loop?

I having problem when I call this cleanupmenu function within a script. It continuously loops and goes to selection * That wasn't a valid selection. I have to kill it everytime to stop it. What am I doing wrong. I use this function menu in several other scripts and I don't have this problem at all. Also, when I don't use this menu as a function and put it at the end of this script it does the same thing.

#!/bin/ksh
#
realname=` who -m | awk '{print $1}'`
#
# Create Cleanup Choice Menu Function
#------------------------------------------------------------------
cleanupmenu ()
{
echo " $realname Choose your Options"
echo " "
echo "1. Review Queue script before execution "
echo "2. Execute Script on $QMGR"
echo " "
echo "x Exit Menu "
echo "--->\c" | tee -a $LOG
read
case $REPLY in
1 ) page $QL_LOG3 ;;
2 ) runmqsc $QMGR < $QL_LOG3 | tee -a $LOG ; echo " Exiting ..Goodbye $realname!" ;;
x|X ) echo " Exiting ..Goodbye $realname!" ; break;;
* ) echo "$realname That wasn\'t a valid Menu Selection! Try Again." ; sleep 1 ;;
esac
}

echo "Hello $realname" | tee $LOG

echo "$realname - What Queue Manager would you like to use?: \c" | tee -a $LOG
read QMGR
echo "You chose $QMGR" | tee -a $LOG

echo "extracting amq3 file names"
sleep 1
print "dis ql(AMQ.3*);" | runmqsc $QMGR >$QL_LOG1
awk /QUEUE/ $QL_LOG1 | cut -f2 -d\( | cut -f1 -d\) | sort >$QL_LOG2

exec < $QL_LOG2
while read line ; do
echo 'delete qlocal('${line}')' >>$QL_LOG3
done

cleanupmenu

With that exec statement you set the script's standard-in to a file. Then with that loop you read all the data. At this point, standard-in is at end-of-file. Then you call cleanupmenu which contains a read statement. That read statement will try to read one more line from the $QL_LOG2 file but it won't succeed. You need to add
exec < /dev/tty
before you invoke cleanupmenu to put standard-in back to being the tty.

Thanks!