fixed the getInput function