working on database and the model