added assignRegistry singleton plus tests