fixed bug giving null pointer exception when validating constraints