fix case when reference doesn't exist