Fixed getInput method with a default value