added type namespace to typechecking to fix the "this" problem