Added support for screen rotation