Wrong method being called for generating a password