entity cascading, avoid NPE