improved validation checks