fix _handleSelection when data is null