Fixing issue with hiding controls when only one page is visible