better clean up for module updating