added some constraints to entity