do not delete app unless its really empty

fix bz919379
[merge]