Added comments for thread safety