updated $password to $str