added method for landscape and portrait orientation changes