minor fix - validity check