prevent entity undefined errors