fixed issues with orientation changes