changed how the static data is allocated such that it gets trashed properly