better handling of the orientation changes