Fixed is null error in sidebar js