updated example and added support for multiple apps