Wrote entity collision check.