Hard to tell, since you haven't posted it all.


Where is the code that sets up the user input ?