removed TypeError from trustlevel code