handling validity