fix check reference bug