fixed bug in constraint handling