Fixed bug with orientation change