Prevent double click when switching between pages with the left and right bar