fixed an issue about using browser globals to define this module