input function fixed