improved 'invalid SID' handling