Changed curSelected reference to private.