clean up global variables