fix error when module is undefined; close #13