Added some debug to the validaton code