Better handling of current tab