bug fix for set_ref

Signed-off-by: lizhizhou <lzz@meteroi.com>