remove bad entity referrence