worked around weirdness of the has_selection function