speculative fix for crash,
adding assertion for thread safety