replaced global variable with module instance variable