fix bug:check buffer size before showing candidate