fix entity constrains