works now, but fails several times