fixed issue where tab was undefined