Checking for validity of the poly