tab open close event listening etc.
now only missing minor details!