Modified app detection logic