BUGFIX - Reordened the app functions