Fix app order to handle models dependencies