add constraints key and casting