Fixing installer error on password save. $dir not defined, so defining it at the top of the file.