Selector can be unset on client. If so, create it.

We had an issue where `selector` was undefined on the client. I added a couple of `if`s to create it if it doesn't already exist.