Avoid leaky global var

fixes #3