Handled edge case in file input function.