Added orientation change detection