fixing hiding and showing of table