add database and more beautyful debug