MARI-69 updated to popup dialog only when app is not running in foreground