remove the newline character if the passwords ends with it