Fix the generated pwd not clear when the input is empty