fixed the issue with changing the orientation