Fix the bug for the bound check

Signed-off-by: Yongqin Liu  <liuyq0307@thundersoft.com>