change database & add register function