added logic to tabs