code refine based on comments for previous check.

Signed-off-by: Henry Chen <hchen@vmware.com>