Adding register function in db