fixing bug on multiple tabs