Add threading locks in Keep client