Putting in check for more than just null for namespace - it could be undefined as well!