Bug Fix:input function