Your comments

Thanks for the tip. That does resolve the issue. And then it keeps working in both portrait and landscape.