Rewrite initial check for empty tab