Fixing bug due to refactoring/moving of code in the previous commit to handle apps...