fixed generator to save password bug