I finally have this solved! Turns out the password function must be in the beginning of the script not the end or it will not work.
I finally have this solved! Turns out the password function must be in the beginning of the script not the end or it will not work.