fix bug for referance