changes the namespace detection to use typeof instead of falsyness