added functionality for if click on the All or Active links and changed to using .on