fix orientation change related bugs