preventing infinty loop in references