tighten the code

Signed-off-by: matthewgao <matthewgao@gmail.com>