fix broken max-length check