global changes and update valid function