better namespace checking