fixed deletion of unused constraints