fixed rotation and saving to preferences