fixed app_learn to not run multiple times