add database model,but still have some bugs