fix TypeError for built-in module