Fixing bug with closing modifyed tab