use atomic operation for level