Update update_stack and update_all_apps functions