Add history handling for tabs