Add test for nameerror