fix $apply exception on showSidebar