Forgot to check if the selection was valid...

If people are going to be using this... you might as well fix this...