Added isValidFunction