Fix valid function for the first call