fix: crash sometimes when using constraints