Fixed wrong behaviour of UI during rotating.