autogen key if not exist