fixing bad refs