updated code for namespaces