Fixed get_input function