updated logic to support applications
Merge remote-tracking branch 'origin/master'