fix bug in namespace module
apply namespace when constructing a theory