tracking tab and allowing for closing one tab at a time