added helper function to prepare apps and update navigate function