removed log added length check