fixing bug with portrait mode