@akaguara added the if else case when generating the key