Fix use of constrain

Fix use of constrain