fixed maxLen bug