fix for autorotate (issue #89)