Fixed crash on portrait mode