null switch when setting the references