Fix for js running before sidebar appears