Prevent nullreferenceexception if nothing is selected