Moving down the doLayout from main page because sometimes it failed