Split main program in modules and data validation now work fine.