implemented get_application_in_foreground