this should be under lock too, of course