fixed segfault when generating new passwords