fixes #2, but needs some threading