Optimized and fixed problem in selector.