added functions for module unload