Adding event hook for tab change