cleaned up some leaked global vars