fix fks
fix constraints bug