Added frontmost app tracking