this should either be synchronized or documented as not thread-safe