more code refine for previous fix

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