Fix a bug that the sub app will share the factories with the parents