Cache selector in afterRender function

- cache selector in a variable to prevent recomputing it in the function.