Attempt to fix race condition when calling analyze and then clear