Use isinstance to check if string type.