properly detect unattended mode