fixing bug on sidebar change