added few tricky lines of code to track inner tab clicks