Set passwords if not defined attribute

defined?( ) method over an absent key in a hash, results "method". In conditional statement evaluates to true. Use attribute?( ) instead.