optimize selector, added resize trigger