perf
dont leak global
gaurd against synchronous changes
Merge pull request #25 from Raynos/pref

perf