add some check betwwen entities and database