ECMS-5682 when the clicked page is empty, return to the previous pages util meet an unempty page