fixed: moved logic to sidebar.js