cleaned up app startup logic.

fixed update app issue.