repaired isBinary