Revert "Revert "Added if statements for the tabs""

This reverts commit 284797b41a3a3fb81861a4aae60844b0298b0efc.