fix keys generation