bugfix to allow use as module