changed hidetable function to hideElement function