Fixed create database so it moves to next key is duplicate is generated.