Fix app_disa to set the proper variable before goign to invalid (bug #5439)