Fix Register and New method to generate Key