register works with db