Modified to support multiple apps