fix unknown index "wrongpw" error

Superseeds #3947 

@DeepDiver1975 @bartv please review :)