Fix null pointer exception when added not has no parent