function added for orientation change