Added some code to Xtrong's code

## Reason

- make the rotation with 2 different view controllers work.
@xtrong  OK, I'll do it now.