I changed this function last week to get multi-site registration to work, but now I've found a better way to do it so I'm changing it back