use database into model