saving to database with namespaces fix