test for thread safety