fix error passing in fetchModule, add tests