active tab checking with validation