Used boolean to detect selected rather than setting to null to avoid
null exception