Database insertion works