Checking that selection exists before adding element.