Add logic to data lookup to deal with stack&app