Need to add isinstance() to IsValidLine()